﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:DataGrid="clr-namespace:Test.Silverlight.DataGrid">

    <Style TargetType="DataGrid:AgToggleButton">
        <Setter Property="IsEnabled" Value="true" />
        <Setter Property="Background" Value="#FF003255" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Cursor" Value="Arrow" />
        <Setter Property="FontSize" Value="11" />
        <Setter Property="Width" Value="20" />
        <Setter Property="Height" Value="20" />
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="DataGrid:AgToggleButton">
                    <Grid x:Name="RootElement">
                        <Grid.Resources>
                            <!-- Visual constants used by the template -->
                            <Color x:Key="BaseColor">#FF003255</Color>
                            <Color x:Key="LinearBevelLightStartColor">#FCFFFFFF</Color>
                            <Color x:Key="LinearBevelLightEndColor">#F4FFFFFF</Color>
                            <Color x:Key="LinearBevelDarkStartColor">#E0FFFFFF</Color>
                            <Color x:Key="LinearBevelDarkEndColor">#B2FFFFFF</Color>
                            <Color x:Key="MouseOverLinearBevelDarkEndColor">#7FFFFFFF</Color>
                            <Color x:Key="HoverLinearBevelLightStartColor">#FF909090</Color>
                            <Color x:Key="HoverLinearBevelLightEndColor">#FF909090</Color>
                            <Color x:Key="HoverLinearBevelDarkStartColor">#FF505050</Color>
                            <Color x:Key="HoverLinearBevelDarkEndColor">#FF505050</Color>
                            <Color x:Key="CheckedLinearBevelLightStartColor">#FF404040</Color>
                            <Color x:Key="CheckedLinearBevelLightEndColor">#FF404040</Color>
                            <Color x:Key="CheckedLinearBevelDarkStartColor">#FF505050</Color>
                            <Color x:Key="CheckedLinearBevelDarkEndColor">#FF505050</Color>
                            <Color x:Key="CurvedBevelFillStartColor">#B3FFFFFF</Color>
                            <Color x:Key="CurvedBevelFillEndColor">#3CFFFFFF</Color>
                            <Color x:Key="HoverPressedCurvedBevelFillStartColor">#6FFFFFFF</Color>
                            <Color x:Key="HoverPressedCurvedBevelFillEndColor">#39FFFFFF</Color>
                            <SolidColorBrush x:Key="BorderBrush" Color="#FF000000" />
                            <SolidColorBrush x:Key="AccentBrush" Color="#FFFFFFFF" />
                            <SolidColorBrush x:Key="DisabledBrush" Color="#A5FFFFFF" />
                            <LinearGradientBrush x:Key="FocusedStrokeBrush" StartPoint="0.5,0" EndPoint="0.5,1">
                                <GradientStop Color="#B2FFFFFF" Offset="0" />
                                <GradientStop Color="#51FFFFFF" Offset="1" />
                                <GradientStop Color="#66FFFFFF" Offset="0.325" />
                                <GradientStop Color="#1EFFFFFF" Offset="0.325" />
                            </LinearGradientBrush>

                        </Grid.Resources>

                        <Rectangle x:Name="Background" RadiusX="4" RadiusY="4" Fill="{TemplateBinding Background}" />
                        <Rectangle x:Name="BackgroundGradient" RadiusX="4" RadiusY="4" StrokeThickness="1" Stroke="{StaticResource BorderBrush}">
                            <Rectangle.Fill>
                                <LinearGradientBrush StartPoint="0.7,0" EndPoint="0.7,1">
                                    <GradientStop x:Name="LinearBevelLightStart" Color="{StaticResource LinearBevelLightStartColor}" Offset="0" />
                                    <GradientStop x:Name="LinearBevelLightEnd" Color="{StaticResource LinearBevelLightEndColor}" Offset="0.35" />
                                    <GradientStop x:Name="LinearBevelDarkStart" Color="{StaticResource LinearBevelDarkStartColor}" Offset="0.35" />
                                    <GradientStop x:Name="LinearBevelDarkEnd" Color="{StaticResource LinearBevelDarkEndColor}" Offset="1" />
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Grid x:Name="CurvedBevelScale" Margin="2" Opacity="0">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="7*" />
                                <RowDefinition Height="3*" />
                            </Grid.RowDefinitions>
                            <Path x:Name="CurvedBevel" Stretch="Fill" Margin="3,0,3,0" Data="F1 M 0,0.02 V 0.15 C 0.15,0.22 0.30,0.25 0.50,0.26 C 0.70,0.26 0.85,0.22 1,0.15 V 0.02 L 0.97,0 H 0.02 L 0,0.02 Z">
                                <Path.Fill>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop x:Name="CurvedBevelFillStart" Color="{StaticResource CurvedBevelFillStartColor}" Offset="0" />
                                        <GradientStop x:Name="CurvedBevelFillEnd" Color="{StaticResource CurvedBevelFillEndColor}" Offset="1" />
                                    </LinearGradientBrush>
                                </Path.Fill>
                            </Path>
                        </Grid>
                        <Rectangle x:Name="Accent" RadiusX="3" RadiusY="3" Margin="1" Stroke="{StaticResource AccentBrush}" StrokeThickness="1" />
                        <Grid x:Name="Checked" Opacity="0">
                            <Rectangle x:Name="CheckedBackgroundGradient" RadiusX="4" RadiusY="4" StrokeThickness="1" Stroke="{StaticResource BorderBrush}">
                                <Rectangle.Fill>
                                    <LinearGradientBrush StartPoint="0.7,0" EndPoint="0.7,1">
                                        <GradientStop x:Name="CheckedLinearBevelLightStart" Color="{StaticResource CheckedLinearBevelLightStartColor}" Offset="0" />
                                        <GradientStop x:Name="CheckedLinearBevelLightEnd" Color="{StaticResource CheckedLinearBevelLightEndColor}" Offset="0.35" />
                                        <GradientStop x:Name="CheckedLinearBevelDarkStart" Color="{StaticResource CheckedLinearBevelDarkStartColor}" Offset="0.35" />
                                        <GradientStop x:Name="CheckedLinearBevelDarkEnd" Color="{StaticResource CheckedLinearBevelDarkEndColor}" Offset="1" />
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <Rectangle Stroke="{TemplateBinding Background}" RadiusX="3" RadiusY="3" StrokeThickness="1.5" Opacity="0.05" Margin=".5,2.5,.5,.5" />
                            <Rectangle Stroke="{TemplateBinding Background}" RadiusX="3" RadiusY="3" StrokeThickness="1.5" Opacity="0.05" Margin=".5,2.25,.5,.5" />
                            <Rectangle Stroke="{TemplateBinding Background}" RadiusX="3" RadiusY="3" StrokeThickness="1.5" Opacity="0.05" Margin=".5,2,.5,.5" />
                            <Rectangle Stroke="{TemplateBinding Background}" RadiusX="3" RadiusY="3" StrokeThickness="1.5" Opacity="0.05" Margin=".5,1.75,.5,.5" />
                            <Rectangle Stroke="{TemplateBinding Background}" RadiusX="3" RadiusY="3" StrokeThickness="1.5" Opacity="1" Margin=".5" />
                            <Rectangle RadiusX="4" RadiusY="4" StrokeThickness="1.5"  Margin=".5">
                                <Rectangle.Stroke>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#90FFFFFF" Offset="0" />
                                        <GradientStop Color="#FFFFFFFF" Offset="1" />
                                    </LinearGradientBrush>
                                </Rectangle.Stroke>
                            </Rectangle>
                        </Grid>
                        <ContentControl
                              VerticalAlignment="Center"
                              HorizontalAlignment="Center"
                              Content="{TemplateBinding Content}"
                              ContentTemplate="{TemplateBinding ContentTemplate}"
                              HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                              Padding="{TemplateBinding Padding}"
                              VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                              IsHitTestVisible="false">
                            <ContentControl.Foreground>
                                <SolidColorBrush x:Name="TextColor" Color="Black"/>
                            </ContentControl.Foreground>
                        </ContentControl>
                        <Rectangle x:Name="Disabled" RadiusX="4" RadiusY="4" Fill="{StaticResource DisabledBrush}" Opacity="0" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="DataGrid:AgToolTip">
        <Setter Property="FontSize" Value="13"/>
        <Setter Property="Foreground" Value="#FFFFFFFF"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="DataGrid:AgToolTip">
                    <Grid Opacity=".8">
                        <Border x:Name="tooltip_shadow" CornerRadius="6,6,6,6" Margin="3,3,0,0" Background="#FF000000" Opacity="0.15"/>
                        <Border HorizontalAlignment="Stretch" Margin="0,0,3,3" VerticalAlignment="Stretch" Width="Auto" Background="#FF404455" CornerRadius="5,5,5,5" Padding="1,1,1,1">
                            <Border CornerRadius="4,4,4,4" Padding="12,12,12,12" Background="#FF5D6174">
                                <ContentControl
                                      Content="{TemplateBinding Content}"
                                      ContentTemplate="{TemplateBinding ContentTemplate}"
                                      Cursor="{TemplateBinding Cursor}"
                                      HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                      Padding="{TemplateBinding Padding}"
                                      VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
                            </Border>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="DataGrid:AgPreviewToolTip">
        <Setter Property="FontSize" Value="13"/>
        <Setter Property="Foreground" Value="#FFFFFFFF"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="DataGrid:AgPreviewToolTip">
                    <Grid>
                        <Border Margin="3,3,0,0" x:Name="tooltip_shadow1" Opacity="0.15" Background="#FF000000" CornerRadius="6,6,6,6"/>
                        <Border HorizontalAlignment="Stretch" Margin="0,0,3,3" VerticalAlignment="Stretch" Width="Auto" CornerRadius="5,5,5,5" Padding="1,1,1,1" Background="#FF9B9B9B">
                            <Border CornerRadius="4,4,4,4" Padding="12,12,24,12">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.303999990224838,-0.0140000004321337" StartPoint="0.695999979972839,1.01400005817413">
                                        <GradientStop Color="#FFE6E6E6"/>
                                        <GradientStop Color="#FFF4F4F4" Offset="1"/>
                                    </LinearGradientBrush>
                                </Border.Background>
                                <ContentPresenter
                                      Content="{TemplateBinding Content}"
                                      ContentTemplate="{TemplateBinding ContentTemplate}"/>
                            </Border>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>